home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group98b.txt
/
000087_icon-group-sender _Mon Jun 15 16:24:49 1998.msg
< prev
next >
Wrap
Internet Message Format
|
2000-09-20
|
3KB
Return-Path: <icon-group-sender>
Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA18510
for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Mon, 15 Jun 1998 16:24:49 -0700 (MST)
Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
id AA19502; Mon, 15 Jun 1998 16:24:40 -0700
From: gep2@computek.net
Date: Mon, 15 Jun 1998 14:52:04 -0500
Message-Id: <199806151952.OAA02701@axp.cmpu.net>
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Subject: Re: Directory access facilities
To: icon-group@optima.CS.Arizona.EDU
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@optima.CS.Arizona.EDU
Status: RO
Content-Length: 1993
>> Anyone else have ideas (or votes) on how to do directory access
> facilities?
> My admittedly biased and possibly Unix-centric view: we don't need any
elaborate solutions, I think the idea of each read() returning one entry
from the directory is the best one. This finesses all the issues of quoting
blanks, quotes, wildchars etc. etc.
"Finesses" -> "Ignores".
> If you need more information about the
entry, you use the function that performs this query. In Unicon, you use
stat(), which returns a record. Here's the "ls" example:
> f := open(".") | stop( ... )
while write( format( stat( read(f) ) ) )
The problem (if you want something RELIABLE) with this kind of thing is that on
multitasking systems (especially those crossing boundaries through a network)
the entries can be changing (and entries even being added and deleted) WHILE you
are retrieving your way through them. It's much more robust to return a
snapshot, which at least _was_ valid and consistent at the time the snapshot was
taken.
It's entirely possible that (for example) the read(f) returns a temporary file
name, which is no longer there by the time the stat() is issued for it. If
stat() failed (e.g.) in such a case, then you'd terminate your while loop
prematurely.
Agreed that it's almost as flakey to try to load a snapshot into a table in
memory... where that table could be of nearly arbitrary size... due to both the
memory space available to hold it, and the (atomic) time it takes to generate
such a potentially huge table.
> ...We should stick to a clean and simple interface that will work
unambiguously without all sorts of special cases.
Like the old saying, it should be "as simple as possible... BUT NO SIMPLER."
> Others have already pointed out why a space-separated string of all the
entries is a bad idea.
Agreed, that's not a good solution.
Gordon Peterson
http://www.computek.net/public/gep2/
Support the Anti-SPAM Amendment! Join at http://www.cauce.org/